Encoding is a technique for expressing values in a specific notation (e.g., binary, ASCII, etc.). Encoding is also a method of translating files in one format into another format for electronic transmission. Encoding is used to add security, ease transfer over gateways, or simplify complex communications.
The encoding process represents 24-bit groups as output strings of four encoded characters. Moving from left to right, a 24-bit input group is formed by concatenating (linking together or connecting) three 8-bit input groups. The 24 bits are then treated as 4 connected 6-bit groups, each translated into a single digit in the base 64 alphabet. When you encode a bit stream via base 64 encoding, the bit stream must be assumed to be ordered with the most significant bit first; i. e., the first bit in the stream will be a high order bit in the first bite, the 8th will be the low-order bit in the first byte, and so on.